package pbx.service;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import pbx.model.QueueMember;


@Stateless
public class QueueMemberService {
	
	@PersistenceContext(unitName = "persistence")
    private EntityManager em;
	
	
	public QueueMember getById(Integer id){	
		return em.find(QueueMember.class, id);
	}
    
	public QueueMember save(QueueMember queuemember) {
		em.persist(queuemember);
		return queuemember;   
	}
	
	public QueueMember update(QueueMember queuemember) {
		return em.merge(queuemember);
	}
	
    public void delete(Integer id) {
    	em.remove(em.find(QueueMember.class, id));	
    }
	
	
}

